/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cr.ac.una.sive.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author claribel
 */
@Entity
@Table(name = "HORARIO_RESERVACION_GENERAL", catalog = "", schema = "UNA_SIVE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HorarioReservacionGeneral.findAll", query = "SELECT h FROM HorarioReservacionGeneral h"),
    @NamedQuery(name = "HorarioReservacionGeneral.findByIdHorarioReservacionGeneral", query = "SELECT h FROM HorarioReservacionGeneral h WHERE h.idHorarioReservacionGeneral = :idHorarioReservacionGeneral"),
    @NamedQuery(name = "HorarioReservacionGeneral.findByFecha", query = "SELECT h FROM HorarioReservacionGeneral h WHERE h.fecha = :fecha"),
    @NamedQuery(name = "HorarioReservacionGeneral.findByHoraInicio", query = "SELECT h FROM HorarioReservacionGeneral h WHERE h.horaInicio = :horaInicio"),
    @NamedQuery(name = "HorarioReservacionGeneral.findByHoraFin", query = "SELECT h FROM HorarioReservacionGeneral h WHERE h.horaFin = :horaFin")})
public class HorarioReservacionGeneral implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "SQHORARIO_RESERVACION_GENERAL")
    @SequenceGenerator(name="SQHORARIO_RESERVACION_GENERAL", sequenceName = "SQ_HORARIO_RESERVACION_GENERAL",allocationSize=1)
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_HORARIO_RESERVACION_GENERAL", nullable = false, precision = 0, scale = -127)
    private BigDecimal idHorarioReservacionGeneral;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Size(max = 100)
    @Column(name = "HORA_INICIO", length = 100)
    private String horaInicio;
    @Size(max = 100)
    @Column(name = "HORA_FIN", length = 100)
    private String horaFin;
    @JoinColumn(name = "RESERVACION_GENERAL", referencedColumnName = "ID_RESERVACION_GENERAL")
    @ManyToOne(fetch = FetchType.EAGER)
    private ReservacionGeneral reservacionGeneral;

    public HorarioReservacionGeneral() {
    }

    public HorarioReservacionGeneral(BigDecimal idHorarioReservacionGeneral) {
        this.idHorarioReservacionGeneral = idHorarioReservacionGeneral;
    }

    public BigDecimal getIdHorarioReservacionGeneral() {
        return idHorarioReservacionGeneral;
    }

    public void setIdHorarioReservacionGeneral(BigDecimal idHorarioReservacionGeneral) {
        this.idHorarioReservacionGeneral = idHorarioReservacionGeneral;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getHoraInicio() {
        return horaInicio;
    }

    public void setHoraInicio(String horaInicio) {
        this.horaInicio = horaInicio;
    }

    public String getHoraFin() {
        return horaFin;
    }

    public void setHoraFin(String horaFin) {
        this.horaFin = horaFin;
    }

    public ReservacionGeneral getReservacionGeneral() {
        return reservacionGeneral;
    }

    public void setReservacionGeneral(ReservacionGeneral reservacionGeneral) {
        this.reservacionGeneral = reservacionGeneral;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHorarioReservacionGeneral != null ? idHorarioReservacionGeneral.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HorarioReservacionGeneral)) {
            return false;
        }
        HorarioReservacionGeneral other = (HorarioReservacionGeneral) object;
        if ((this.idHorarioReservacionGeneral == null && other.idHorarioReservacionGeneral != null) || (this.idHorarioReservacionGeneral != null && !this.idHorarioReservacionGeneral.equals(other.idHorarioReservacionGeneral))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cr.ac.una.sive.entidad.HorarioReservacionGeneral[ idHorarioReservacionGeneral=" + idHorarioReservacionGeneral + " ]";
    }
    
}
